<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">KPCA</b>
<td valign="baseline" align="right" class="function"><a href="../../kernels/extraction/index.html" target="mdsdir"><img border = 0 src="../../up.gif"></a></table>
  <p><b>Kernel Principal Component Analysis.</b></p>
  <hr>
<div class='code'><code>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;kpca(X)</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;kpca(X,options)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;This&nbsp;function&nbsp;is&nbsp;implementation&nbsp;of&nbsp;Kernel&nbsp;Principal&nbsp;Component&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;Analysis&nbsp;(KPCA)&nbsp;[<a href="../../references.html#Schol98b" title = "" >Schol98b</a>].&nbsp;The&nbsp;input&nbsp;data&nbsp;X&nbsp;are&nbsp;non-linearly</span><br>
<span class=help>&nbsp;&nbsp;mapped&nbsp;to&nbsp;a&nbsp;new&nbsp;high&nbsp;dimensional&nbsp;space&nbsp;induced&nbsp;by&nbsp;prescribed</span><br>
<span class=help>&nbsp;&nbsp;kernel&nbsp;function.&nbsp;The&nbsp;PCA&nbsp;is&nbsp;applied&nbsp;on&nbsp;the&nbsp;non-linearly&nbsp;mapped&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;data.&nbsp;The&nbsp;result&nbsp;is&nbsp;a&nbsp;model&nbsp;describing&nbsp;non-linear&nbsp;data&nbsp;projection.</span><br>
<span class=help>&nbsp;&nbsp;See&nbsp;'help&nbsp;kernelproj'&nbsp;for&nbsp;info&nbsp;how&nbsp;to&nbsp;project&nbsp;data.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Training&nbsp;data.</span><br>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;options&nbsp;[struct]&nbsp;Decribes&nbsp;kernel&nbsp;and&nbsp;output&nbsp;dimension:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.ker&nbsp;[string]&nbsp;Kernel&nbsp;identifier&nbsp;(see&nbsp;'help&nbsp;kernel');&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(default&nbsp;'linear').</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.arg&nbsp;[1&nbsp;x&nbsp;narg]&nbsp;kernel&nbsp;argument;&nbsp;(default&nbsp;1).</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.new_dim&nbsp;[1x1]&nbsp;Output&nbsp;dimension&nbsp;(number&nbsp;of&nbsp;used&nbsp;principal&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;components);&nbsp;(default&nbsp;num_data).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;[struct]&nbsp;Kernel&nbsp;projection:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.Alpha&nbsp;[num_data&nbsp;x&nbsp;new_dim]&nbsp;Multipliers.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.b&nbsp;[new_dim&nbsp;x&nbsp;1]&nbsp;Bias.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.sv.X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Training&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.nsv&nbsp;[1x1]&nbsp;Number&nbsp;of&nbsp;training&nbsp;data.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.eigval&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Eigenvalues&nbsp;of&nbsp;centered&nbsp;kernel&nbsp;matrix.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.mse&nbsp;[1x1]&nbsp;Mean&nbsp;square&nbsp;representation&nbsp;error&nbsp;of&nbsp;maped&nbsp;data.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.MsErr&nbsp;[dim&nbsp;x&nbsp;1]&nbsp;MSE&nbsp;with&nbsp;respect&nbsp;to&nbsp;used&nbsp;basis&nbsp;vectors;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mse=MsErr(new_dim).</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.kercnt&nbsp;[1x1]&nbsp;Number&nbsp;of&nbsp;used&nbsp;kernel&nbsp;evaluations.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.options&nbsp;[struct]&nbsp;Copy&nbsp;of&nbsp;used&nbsp;options.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.cputime&nbsp;[1x1]&nbsp;CPU&nbsp;time&nbsp;used&nbsp;for&nbsp;training.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;X&nbsp;=&nbsp;gencircledata([1;1],5,250,1);</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;kpca(&nbsp;X,&nbsp;struct('ker','rbf','arg',4,'new_dim',2));</span><br>
<span class=help>&nbsp;&nbsp;XR&nbsp;=&nbsp;kpcarec(&nbsp;X,&nbsp;model&nbsp;);</span><br>
<span class=help>&nbsp;&nbsp;figure;&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;ppatterns(&nbsp;X&nbsp;);&nbsp;ppatterns(&nbsp;XR,&nbsp;'+r'&nbsp;);</span><br>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;<span class=also_field>See also </span><span class=also></span><br>
<span class=help><span class=also>&nbsp;&nbsp;<a href = "../../kernels/kernelproj.html" target="mdsbody">KERNELPROJ</a>,&nbsp;<a href = "../../linear/extraction/pca.html" target="mdsbody">PCA</a>,&nbsp;<a href = "../../kernels/extraction/gda.html" target="mdsbody">GDA</a>.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;</span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../../kernels/extraction/list/kpca.html">kpca.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 2-jun-2008, VF, default new_dim changed to num_data; suggested by Claudio Lopez<br>
 4-may-2004, VF<br>
 10-july-2003, VF, computation of kercnt added<br>
 22-jan-2003, VF<br>
 11-july-2002, VF, mistake "Jt=zeros(N,L)/N" repared <br>
              (reported by SH_Srinivasan@Satyam.com).<br>
 5-July-2001, V.Franc, comments changed<br>
 20-dec-2000, V.Franc, algorithm was implemented<br>

</body>
</html>
